import request from '@/utils/request'

export const getEmployeeList = params => request.get('/sys/user', { params })

export const exportList = () => request.get('/sys/user/export', { responseType: 'blob' })

export const exportTemplate = () => request.get('/sys/user/import/template', { responseType: 'blob' })

export const uploadExcel = data => request.post('/sys/user/import', data)

export const addEmployee = data => request.post('/sys/user', data)

export const delEmployee = id => request.delete(`/sys/user/${id}`)

export const getEmployee = id => request.get(`/sys/user/${id}`)

export const updateEmployee = data => request.put(`/sys/user/${data.id}`, data)

export const getEmployeeEnabled = () => request.get('/sys/role/list/enabled')

export const assignRole = data => request.put('/sys/user/assignRoles', data)

